{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "altered-exclusive",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/encode-and-decode-tinyurl\n",
    "\n",
    "\n",
    "Runtime: 56 ms, faster than 5.53% of Python3 online submissions for Encode and Decode TinyURL.\n",
    "Memory Usage: 14.3 MB, less than 59.29% of Python3 online submissions for Encode and Decode TinyURL.\n",
    "\n",
    "\n",
    "```python\n",
    "class Codec:\n",
    "    #6:08\n",
    "    #6:11\n",
    "\n",
    "    def encode(self, longUrl: str) -> str:\n",
    "        \"\"\"Encodes a URL to a shortened URL.\n",
    "        \"\"\"\n",
    "        return longUrl*2\n",
    "        \n",
    "\n",
    "    def decode(self, shortUrl: str) -> str:\n",
    "        \"\"\"Decodes a shortened URL to its original URL.\n",
    "        \"\"\"\n",
    "        return shortUrl[:len(shortUrl)//2]\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "complex-philosophy",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
